# -*- coding: utf-8 -*-

f = open('fileIo.txt', 'w')
f.write('test')
f.close()


f =open('fileIo.txt', 'r')
print (f.read())
f.close()

f=open('fileIo2.txt','w')
for i in range(1, 10):
    data = "2*%d = %d \n" % (i, 2 * i)
    f.write(data)
f.close()

f=open('fileIo2.txt')
line=f.readline()
while line:
    print(line),
    line=f.readline()
f.close()


f=open('fileIo3.txt','w')
f.write('가나다\n라마바\n사아자\n차카타\n파하')
f.close

f=open('fileIo3.txt','r')
f.tell()
print (f.read())
print (f.tell())
f.seek(0)
print (f.readline())
f.tell()
f.close()